<script type="text/javascript">
$(function(){
	var pg = App.soagov.home.ui, pp = pg.params,infoPl=pg.parent(),resList=pg.seek('resList'),
		resArr=[];
	
	var w = mac.wait('Loading');

	pg.seek('mac-rpc').click(function() {
		var f=pg.seek('form2');
		f[0].submit();
	})
	//获取最近部署计划
	function getRecentEditService() {
		$.post(App.soagov.ctx + '/flow/find.do', {
			pageSize:20,
			pageNo:1
		}, function(rs){
			w.close();
			var ro = mac.eval(rs);
			if (ro.success) {
				resArr = ro.data.list;
				renderresList(resArr);
			}else{
			}
		});
	}

	//渲染最近编辑过的服务列表
	function renderresList(arr) {

		resList.empty();
		for(var index in arr){
			resList.append(
				'<li class="item " name="res"'+' id=res_'+index+' > <a>'+arr[index].name+'</a></li>'
			)
		}
		pg.seek('res').click(function(e) {
			var f=pg.seek('form1');
			var tempIndex = e.currentTarget.id.substr(4);
			f.seek('id').val(resArr[tempIndex].id);
			f.seek('code').val(resArr[tempIndex].code);
			f.seek('name').val(resArr[tempIndex].name);
			f.seek('appId').val(resArr[tempIndex].appId);
			f.seek('url').val(resArr[tempIndex].url );
			f[0].submit();
		})
	}

	function adjust(){
		var p = pg.parent(),h = p.height() - 16;
		pg.height(h);
		pg.seek('resList').height(pg.find('.fi').height()-50);
	}
	$(window).resize(adjust);
	adjust();
	getRecentEditService(); 
});
</script>
<form name="form1" method="post" action="/soagov/flow/edit.do" target="_blank">
	<input type="hidden" name="id" />
	<input type="hidden" name="code" />
	<input type="hidden" name="name" />
	<input type="hidden" name="type" value="0" />
	<input type="hidden" name="catalog" value="soagov" />
	<input type="hidden" name="appId" />
	<input type="hidden" name="url" />
</form>
<form name="form2" method="get" action="/mac-rpc/index.htm#mac-rpc" target="_blank">
</form>
<div class="fi">
	<div class="head">最近编辑过的服务</div>
	<ul class="list" name="resList">
	</ul>
</div>
<div class="fi fi-wirhout-border">
	<ul class=list>
		<li class="item"><a name="mac-rpc">mac-rpc管控</a></li>
	</ul>
</div>